package com.base.common.dao;

import com.base.common.DBAccess;

public class UserDAO {
	
	private DBAccess dbAccess = new DBAccess();

	
	public DBAccess getDbAccess() {
		return dbAccess;
	}


	public void setDbAccess(DBAccess dbAccess) {
		this.dbAccess = dbAccess;
	}

	public boolean isValid(String username,String password){
		boolean isvalid = false;
		if(dbAccess.createConn()){
			String sql = "select * from tb_user where USER_LOGIN_NAME='"+username+"' and PASSWORD='"+password+"'";
			dbAccess.query(sql);
			if(dbAccess.next()){
				isvalid = true;
			}
			dbAccess.closeRs();
			dbAccess.closeStm();
			dbAccess.closeConn();
		}
		return isvalid;
	}
}
